﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class SumUtils
    {

        private int a;
        private int b;
        private double xa;
        private double xb;
        private string za;
        private string zb;
        private int j;
        public SumUtils(int a, int b)
        {
            this.a = a;
            this.b = b;
        }
        public void intjia()
        {
            Console.WriteLine("两个整数相加的和为"+(this.a+this.b));
        }

        public SumUtils(double xa, double xb)
        {
            this.xa = xa;
            this.xb = xb;
        }
        public void doublejia()
        {
            Console.WriteLine("两个小数相加的和为" + (this.xa + this.xb));
        }

        public SumUtils(string za, string zb)
        {
            this.za = za;
            this.zb = zb;
        }
        public void stringjia()
        {
            Console.WriteLine("两个字符串相加为" + (this.za + this.zb));
        }

        public SumUtils(int j)
        {
            this.j = j;
        }
        public void yitne()
        {
            int sum = 0;
            for (int i = 1; i <= j; i++)
            {
                sum = sum + i;

            }
            Console.WriteLine(" 1 到指定整数的和为" + (sum));
        }
    }
}
